home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / UTILITY1 / HK10.ZIP / HKSRC.ZIP / HK.H < prev    next >
C/C++ Source or Header  |  1993-07-12  |  4KB  |  111 lines

  1. //===========================================================
  2. // HK.H -- Header File 
  3. // Copyright (c) 1993 Douglas Boling
  4. //===========================================================
  5. //-----------------------------------------------------------
  6. // Generic defines and data types
  7. //-----------------------------------------------------------
  8. #if !defined(WIN32)
  9.   #define WIN16     TRUE
  10.   #define WIN31
  11.  
  12.   #define INT       int
  13.   #define UINT      WORD
  14.   #define APIENTRY  PASCAL
  15.   #define WNDPROC   FARPROC
  16. #else
  17.   #define WIN16     FALSE
  18. #endif
  19.  
  20. struct decodeUINT {                         // structure associates
  21.     UINT Code;                              // messages 
  22.     LONG (*Fxn)(HWND, UINT, UINT, LONG);    // with a function
  23. }; 
  24. struct decodeCMD {                          // structure associates
  25.     UINT Code;                              // menu IDs with a 
  26.     LONG (*Fxn)(HWND, UINT, HWND, UINT);    // function
  27. };
  28. //
  29. // Function prototypes used by generic template
  30. //
  31. INT  APIENTRY WinMain(HANDLE, HANDLE, LPSTR, INT);
  32. LONG CALLBACK MainWndProc(HWND, UINT, UINT, LONG);
  33. BOOL CALLBACK AboutDlgProc (HWND, UINT, UINT, LONG);
  34.  
  35. INT  InitApp(HANDLE);
  36. INT  InitInstance(HANDLE, LPSTR, INT);
  37. INT  TermInstance(HANDLE, INT);
  38. INT  MyDisplayDialog (HINSTANCE, LPCSTR, HWND, WNDPROC, LPARAM);
  39. BOOL MyGetFilename (HWND, char *, INT, char *, INT);
  40. BOOL MyWritePrivateProfileInt (char *, char *, int, int, char *);
  41. WNDPROC MySubClassWindow (HWND, WNDPROC);
  42. //
  43. // Data types needed for program
  44. typedef struct {
  45.     UINT    wKey;
  46.     HWND    hwndChild;
  47.     BOOL    fRunning;
  48.     char    szCmdLine[MAXCMDLINELEN];
  49. } HKENTRY;
  50. typedef HKENTRY *PHKENTRY;
  51. //
  52. // Program specific prototypes
  53. //
  54. // Window procedures
  55. LONG CALLBACK HKChildWndProc(HWND, UINT, UINT, LONG);
  56. LONG CALLBACK EditSCProc(HWND, UINT, UINT, LONG);
  57. // Dialog box functions
  58. BOOL CALLBACK AddDlgProc (HWND, UINT, UINT, LONG);
  59. // Message handler functions
  60. LONG DoCreateMain (HWND, UINT, UINT, LONG);
  61. LONG DoTimerMain (HWND, UINT, UINT, LONG);
  62. LONG DoSizeMain (HWND, UINT, UINT, LONG);
  63. LONG DoCloseMain (HWND, UINT, UINT, LONG);
  64. LONG DoDestroyMain (HWND, UINT, UINT, LONG);
  65. LONG DoCommandMain (HWND, UINT, UINT, LONG);
  66. LONG DoGetHotKeyMain (HWND, UINT, UINT, LONG);
  67. LONG DoHKWinRIPMain (HWND, UINT, UINT, LONG);
  68. LONG DoHKWinErrMain (HWND, UINT, UINT, LONG);
  69. // Control function Prototypes
  70. LONG DoMainCtlKeyList (HWND, UINT, HWND, UINT);
  71. LONG DoMainCtlAdd (HWND, UINT, HWND, UINT);
  72. LONG DoMainCtlDel (HWND, UINT, HWND, UINT);
  73. LONG DoMainCtlEdit (HWND, UINT, HWND, UINT);
  74. LONG DoMainCtlExit (HWND, UINT, HWND, UINT);
  75. LONG DoMainCtlAbout (HWND, UINT, HWND, UINT);
  76. // Utility function prototypes
  77. void FillLB (HWND);
  78. void AddHotKey (HWND, WORD, char *);
  79. void DelHotKey (HWND, WORD);
  80. void AddLBEntry (HWND, PHKENTRY);
  81. char *DispKeyText (UINT, char *, INT);
  82. void SetButtons (HWND);
  83. HWND GetNewAct (HWND);
  84. PHKENTRY FindHKEntry (WORD);
  85. void CreateHKWindow (HWND, PHKENTRY);
  86. //
  87. // Profile String Names
  88. //
  89. #define     PRO_XPOS      "WinPosX"
  90. #define     PRO_YPOS      "WinPosY"
  91.  
  92. #define     PRO_HKLST     "HKArray"
  93. #define     PRO_HKCNT     "HKArrayCnt"
  94. #define     PRO_TIMERFREQ "TimerFreq"
  95. //
  96. // Resource Idendifiers
  97. //
  98. #define     IDD_ADD        101
  99. #define     IDD_DEL        102
  100. #define     IDD_EDIT       103
  101. #define     IDD_ABOUT      104
  102. #define     IDD_EXIT       105
  103. #define     IDD_KEYLIST    106
  104.  
  105. #define     IDD_ADDCMD     200
  106. #define     IDD_ADDKEY     201
  107. #define     IDD_ADDBROWSE  202
  108.  
  109. #define     IDD_PROGSTR    300
  110.  
  111.